<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>bibtex2web: create webpages from BibTeX bibliography files</title>
</head>
<!-- Time-stamp: "2012-01-01 21:31:06 mernst" -->
<body>


<h1>bibtex2web: create webpages from BibTeX bibliography files</h1> <!-- omit from toc -->

<p>
The bibtex2web package creates
webpages from BibTeX bibliography files.  It can be downloaded from
<a href="http://homes.cs.washington.edu/~mernst/software/#bibtex2web">http://homes.cs.washington.edu/~mernst/software/#bibtex2web</a>.
</p>

<p>Contents:</p>
<!-- start toc.  do not edit; run html-update-toc instead -->
    <ul>
      <li><a href="#overview">Overview</a></li>
      <li><a href="#installation-and-use">Installation and use</a></li>
      <li><a href="#fields">BibTeX fields</a></li>
      <li><a href="#arguments">Command-line arguments</a>
        <ul>
          <li><a href="#output-formats">Output formats</a>
            <ul>
              <li><a href="#htmlabstract">htmlabstract</a></li>
              <li><a href="#htmlsummary">htmlsummary</a></li>
              <li><a href="#htmllist">htmllist</a></li>
            </ul></li>
          <li><a href="#templates">Webpage templates</a></li>
        </ul></li>
      <li><a href="#new-chars">Supporting new LaTeX commands</a></li>
      <li><a href="#problems">Reporting problems</a>
        <ul>
          <li><a href="#credits">Credits</a></li>
        </ul></li>
      <li><a href="#implementation-details">Implementation details</a>
        <ul>
          <li><a href="#to-do">To do</a></li>
        </ul></li>
    </ul>
<!-- end toc -->


<hr />
<h2><a name="overview">Overview</a></h2>

<p>
It is convenient to produce webpages from BibTeX files, because you only
need to keep one set of (BibTeX) sources up to date, thus avoiding skew
between your webpages and bibliographies.
</p>

<p>
Given a collection of BibTeX files, bibtex2web creates
</p>
<ul>
  <li>one webpage per article (giving the abstract and a BibTeX entry, and
   linking to the article itself and to the authors and venue)</li>
  <li>a webpage listing all articles by date</li>
  <li>a webpage listing all articles by topic</li>
  <li>one webpage per author, listing that author's articles</li>
  <li>a webpage listing all authors</li>
</ul>
<p>
Each of these webpages is built from a template that you can customize to
your liking; see below.
</p>

<p>
Here are two examples of sets of webpages that were created by bibtex2web:
</p>
<ul>
  <li><a href="http://pag.csail.mit.edu/pubs/">http://pag.csail.mit.edu/pubs/</a></li>
  <li><a href="http://pmg.csail.mit.edu/pubs/">http://pmg.csail.mit.edu/pubs/</a></li>
</ul>


<p>
The bibtex2web package consists of three programs:
</p>
<ul>
  <li>bwconv.pl does most of the work</li>
  <li>htmlabstract-split.pl assists with the creation of one webpage per article</li>
  <li>make-author-pages.pl makes the author webpages (by calling bwconv.pl)</li>
</ul>
<p>
For examples of how to call these programs, see file examples/README in
this distribution.
</p>

<p>
Many
<a
href="http://www-sop.inria.fr/members/Gregoire.Malandain/codes/bibtex2html.html#htoc57">other
BibTeX to HTML translators</a> exist.
<!-- That list is out of date.  For example, it does not contain
   http://www.authopilot.com/xml/home.htm
-->
</p>


<hr />
<h2><a name="installation-and-use">Installation and use</a></h2>

<p>
To install bibtex2web, obtain the distribution (linked from <a href="http://homes.cs.washington.edu/~mernst/software/#bibtex2web">http://homes.cs.washington.edu/~mernst/software/#bibtex2web</a>),
unpack it, and then set your BPHOME
environment variable to point to its lib/ directory.  For example, in csh,
add something like
</p>
<pre>
  setenv BPHOME ${HOME}/bibtex2web/lib
</pre>
<p>
to your <tt>.cshrc</tt> file.  You may need to log out and log back in for
this to take effect.
</p>

<p>
Then, you can run the programs in bin/.  (You may add that directory to
your path if you wish, but it is not required.)
</p>

<p>
Files examples/README and examples/Makefile in this distribution for
examples of how to run bibtex2web and examples of the various command-line
arguments that bibtex2web's program accept.  The easiest way to use
bibtex2web is to follow the instructions in examples/README and modify
examples/Makefile to fit your goals.  More details will be added to this
manual later.
</p>


<hr />
<h2><a name="fields">BibTeX fields</a></h2>

<p>
bibtex2web works with ordinary BibTeX files, but it can take advantage of
several additional BibTeX fields:
</p>
<dl>
<dt>
  abstract
</dt>
<dd>
	        The abstract, in LaTeX format.
	        Do not include blank lines to separate paragraphs; use
	        &ldquo;\par&rdquo; instead.
</dd>
<dt>
  basefilename
</dt>
<dd>
		The file name for the article itself, without the
		extension.  Automatically recognized extensions are &ldquo;.ps&rdquo;,
		&ldquo;.pdf&rdquo;, &ldquo;.doc&rdquo;, &ldquo;.ppt&rdquo;, &ldquo;.odp&rdquo;, &ldquo;-slides.ps&rdquo;, &ldquo;-slides.pdf&rdquo;.  You
		must put these files in the destination directory before
		running the programs.  The basefilename is also used for
		the per-article webpage (which includes the abstract).  If
		the basefilename is not specified, then the entry's cite
		key is used instead.
</dd>
<dt>
  downloads
</dt>
<dd>
		A list of other downloads, in addition to those automatically
                detected by virtue of matching the basefilename.  The list
                is semicolon-separated, and each entry consists of a URL
                (which may not contain whitespace) and anchor text (which
                may contain whitespace), separated by whitespace.
</dd>
<dt>
  downloadsnonlocal
</dt>
<dd>
		A list of other downloads, used (in addition to the
                &ldquo;downloads&rdquo; field) only if no local files are
                found via the &ldquo;basefilename&rdquo; mechanism.
		In other words, if you have a &ldquo;basefilename&rdquo;
		attribute, and bibtex2web finds at least one of the files
		it refers to, then bibtex2web skips processing the
		&ldquo;downloadsnonlocal&rdquo; attribute.
</dd>
<dt>
  nodownloads
</dt>
<dd>
		If present, this field suppresses a warning that there are
		no downloads for a given paper.
</dd>
<dt>
  supersededby
</dt>
<dd>
		A comma-separated list of keys of articles that supersede
                this one.  A superseded article does not get its own
                per-article webpage, but is briefly noted on the webpage of
                each article that supersedes it.
		<br /><br />
                Optionally, in the
                comma-separated list, the key may be followed by whitespace
                and (comma-free) text; when bibtex2web generates webpages,
                that text is used instead of &ldquo;A previous version&rdquo;.  For
                instance, in a subsequent TR version, you could add the
                field
                <pre>
                  supersededby = "ConfVer An extended version",
                </pre>
                to ensure that the BibTeX entry with key &ldquo;ConfVer&rdquo; remains
                the canonical version.
</dd>
<dt>
  category
</dt>
<dd>
                The name of the topic under which this article should be
                listed in the by-topic webpage.
		<br /><br />
		In general, when adding a
                new entry, one should choose an existing category rather
                than making up a new one (lest you end up with few papers
                per category, defeating the purpose of this field).
</dd>
<dt>
  summary
</dt>
<dd>
                A brief description of the article that appears in the
                by-topic webpage.  To include the full abstracts of all the
                papers would make that webpage too long.
		For example, see
		<a
		href="http://pag.csail.mit.edu/pubs/bytopic.html">http://pag.csail.mit.edu/pubs/bytopic.html</a>
		(where the standard is a 3-line description in the BibTeX file).
		
</dd>
<dt>
alsosee
</dt>
<dd>
                This field is not currently processed.
</dd>
</dl>


<p>
You can also define your own additional fields.  For instance, the example
Makefile that is distributed with bibtex2web uses the &ldquo;-filter&rdquo; argument
to the programs to make them ignore any article containing an &ldquo;omitfromcv&rdquo;
field.  Additionally, it ignores any entry containing an &ldquo;onlycrossref&rdquo;
field (unless that field was inherited via a crossref); this permits info
about just the conferences from appearing.  Another use of the &ldquo;-filter&rdquo;
argument is to create a separate webpage for any article containing an
&ldquo;underreview&rdquo; field.
</p>


<hr />
<h2><a name="arguments">Command-line arguments</a></h2>

<p>
The main program of the bibtex2web package is bwconv.pl.  You can supply it
a variety of command-line arguments.
</p>

<dl>
<dt>
  -format=<em>informat</em>[,<em>outformat</em>]<br />
  -outformat=<em>outformat</em>
</dt>
<dd>
  Required.  -outformat need not be supplied if the optional
  <em>outformat</em> part of the -format argument is supplied.  For
  instance, legal invocations include:
<pre>
 -format=bibtex,htmlpubs
 -format=bibtex,htmlsummary
 -format=bibtex -outformat=htmlabstract
</pre>
</dd>
<dt>
  -outopts
</dt>
<dd>
  Additional arguments for the output format.
</dd>
<dt>
  -to <em>file</em>
</dt>
<dd>
  Places output in <em>file</em>.
</dd>
</dl>


<h3><a name="output-formats">Output formats</a></h3>

<p>
The output formats supported by bibtex2web are as follows.
</p>


<h4><a name="htmlabstract">htmlabstract</a></h4>

<p>
Creates one page per publication, giving the abstract and other details and
links to the paper itself.
</p>

<p>
If the &ldquo;-linknames <em>link-names-file</em>&rdquo; command-line option is also
given, then each author name (or conference name, etc.) becomes the anchor
text for a link to that author's homepage.  It is recommended that you use,
as the argument to -linknames, the file
<a href="http://plume-lib.googlecode.com/hg/bin/html-canonical-urls"><tt>plume-lib/bin/html-canonical-urls</tt></a>,
from the <a href="http://plume-lib.googlecode.com/">plume-lib</a> project.
You can supply the -linknames option multiple times, so you can use the
html-canonical-urls file and then also your own augmentations.  Feel free
to contribute improvements to the plume-lib version of the file.
</p>

<p>
By contrast, if the linkauthors option is given, then author names
on abstract pages are linked to the authors' publications lists.  Here is
how to customize that behavior:
</p>
<dl>
<dt>
-outopts=linkauthors
</dt>
<dd>
Link author names to authors' (bibtex2web-generated) publications lists.
</dd>
<dt>
-outopts=linkauthors:myauthorslist
</dt>
<dd>
Override the default &ldquo;authors&rdquo; filename.
</dd>
<dt>
-outopts=withbibtex
</dt>
<dd>
Place a BibTeX entry on the summary page, ready for readers to cut and
paste into their own bibliographies.
</dd>
<dt>
-outopts=linkauthors\ withbibtex
</dt>
<dd>
Separate multiple options with spaces.
</dd>
</dl>

<p>
If the &ldquo;-validurls <em>urls-file</em>&rdquo; command-line argument is 
given, then each URL in the file (one per line) is considered to be valid
and is not checked for validity.
</p>



<h4><a name="htmlsummary">htmlsummary</a></h4>

<p>
(The htmlsummary format needs to be documented here.)
</p>


<h4><a name="htmllist">htmllist</a></h4>

<p>
The htmllist output format generates a list of entry titles, each of which
links to the abstract page for that entry, separated by <tt>&lt;br /&gt;</tt> line
breaks.  This is useful to generate a list of &ldquo;recent publications&rdquo; on a
home page.  For example, see &ldquo;Selected Publications&rdquo; list on
<a href="http://pmg.csail.mit.edu/">http://pmg.csail.mit.edu/</a>.
</p>

<p>
Example make rule:
</p>
<pre>
index.html:
        ${BWBIN}/bwconv.pl -format=bibtex,htmllist -outopts=limit:5\ abstract_dir:pubs -headfoot index-headfoot.html -copyright ../copyright -to $@ $(FILTER) ${BIBFILES}
</pre>

<p>
The &ldquo;limit&rdquo; output option limits the list to the specified number of
entries (without this option, list is unlimited).  The &ldquo;abstract_dir&rdquo;
option specifies the relative directory containing the per-entry
abstract files (default &ldquo;../pubs&rdquo;).
</p>



<h3><a name="templates">Webpage templates</a></h3>

<p>
You can specify how the generated webpages look by supplying templates.
The most common of these is supplied by the -headfoot argument to the
bwconv.pl program.
</p>

<p>
A template turns into the final webpage, but certain special strings are
replaced replaced first:
</p>
<dl>
<dt>
BODY
</dt>
<dd>
	contains the actual content produced by bibtex2web
</dd>
<dt>
BIBTEX2WEB_NOTICE
</dt>
<dd>
	is replaced by
<blockquote><p>This page was generated $timestamp by <a
	href="http://homes.cs.washington.edu/~mernst/software/#bibtex2web">bibtex2web</a>
</p></blockquote>
	where $timestamp is the local time in ctime(3) format.
</dd>
<dt>
COPYRIGHT_NOTICE
</dt>
<dd>
	 is replaced by the contents of the file specified by
	the -copyright parameter.
	Bug: this only works for files generated by bwconv directly, so it
	doesn't work yet for the author index page (which uses
	make-author-pages.pl) or the per-paper pages (which uses
	htmlabstract-split.pl).
</dd>
</dl>



<h2><a name="new-chars">Supporting new LaTeX commands</a></h2>

<p>
bibtex2web has built-in support for many LaTeX commands, but you may find
additional commands that are not supported.  A common symptom of an
unsupported command in an abstract is the warning
</p>
<pre>
bp warning (main): Unknown TeX characters (backslashes) in ...
</pre>

<p>
To support a new LaTeX command, you need to add information about how to
convert it to bibtex2web's internal representation (based on Unicode) and
from that representation to HTML and other formats.  A good way to find the
places you need to change is to grep for &ldquo;017C&rdquo;, which is the Unicode code
for a z with a dot above it (&#0380;), or for &ldquo;21D2&rdquo;, which is a right
arrow (&rArr;), and then mimic one or the other of them.
</p>

<p>
You can find Unicode character codes (and HTML equivalents) at one of these URLs:
<a
href="http://www.w3.org/TR/REC-html40/sgml/entities.html">http://www.w3.org/TR/REC-html40/sgml/entities.html</a>,
<a href="http://www.alanwood.net/unicode/arrows.html">http://www.alanwood.net/unicode/arrows.html</a>,
<a href="http://www.alanwood.net/demos/ansi.html">http://www.alanwood.net/demos/ansi.html</a>.
<!-- broken as of 2/5/2014:
<a
href="http://www.fileformat.info/info/unicode/char/search.htm">http://www.fileformat.info/info/unicode/char/search.htm</a>
-->
</p>


<hr />
<h2><a name="problems">Reporting problems</a></h2>

<p>
If you have any problems or questions, please contact Michael Ernst (<a
href="mailto:mernst@cs.washington.edu">mernst@cs.washington.edu</a>).  I will do my
best to help, though I cannot make any guarantee.
</p>

<h3><a name="credits">Credits</a></h3>

<p>
bibtex2web was written by <a
href="http://homes.cs.washington.edu/~mernst/">Michael Ernst</a>, with
contributions by
<a href="http://www.pmg.csail.mit.edu/~ajmani/">Sameer Ajmani</a>.
</p>

<p>
bibtex2web builds on the bp library by Dana Jacobsen.
</p>

<p>
<a href="http://www.cs.cmu.edu/~dga/">David Andersen</a> contributed
patches and suggestions.
</p>

<!--
<p>
Patches and suggestions were contributed by a number of users, including
the following.  (Please let us know if your name was inadvertently omitted
from this list.)
</p>
<ul>
  <li><a href="http://www-2.cs.cmu.edu/~dga/">David Andersen</a></li>
</ul>

-->

<hr />
<h2><a name="implementation-details">Implementation details</a></h2>

<!-- bp is by Dana Jacobsen <dana@acm.org>, webpage http://www.ecst.csuchico.edu/~jacobsd/bib/bp/index.html was dated 2 January 1997 -->

<p>
bibtex2web is built on the bp Perl library.  The bibtex2web
distribution is simply the bp distribution, with corrections and
enhancements.  bp-README is the original README file for the bp Perl
library, and other files and directories have been similarly prefixed with
<code>bp-</code> to avoid confusion to users of bibtex2web.  bp
documentation appeared at at <a
href="http://web.archive.org/web/20071113143006/www.ecst.csuchico.edu/~jacobsd/bib/bp/index.html">http://www.ecst.csuchico.edu/~jacobsd/bib/bp/index.html</a>
(but wasn't packaged with bp itself).  bp has not been supported
since December 1996, but it works well enough for me, particularly with my
enhancements.  (Another library is btool, but bp is better.)  Other systems
exist, but did not have the features I needed.
</p>

<p>
Under both Netscape and Internet Explorer, &lt;br /&gt; needs to be at the end of a
line rather than at the beginning of the next line, because otherwise there
can be two line breaks (i.e., a blank line) rather than just a single line
break.
</p>


<h3><a name="to-do">To do</a></h3>

<p>
Don't require an extra "/dl" close tag after BODY in webpage templates.
</p>

<p>
Change the behavior of "downloadsnonlocal" as follows:
</p>
<ul>
  <li>
    If the entry specifies "basefilename" but no local files are found,
    emit a warning even if "downloadsnonlocal" is present.  (Probably need
    a way to override this.)
  </li>
  <li>
    If both "basefilename" and "downloadsnonlocal" are present, use both
    in some logical way: for instance, the tool could include just those
    nonlocal downloads whose link names are different from any of the
    local downloads.
  </li>
</ul>

<p>
Permit multiple categories per entry, because some entries span categories.
I'm not sure how to do this without overhauling bwconv.pl.
</p>

<p>
Add additional cross-reference types (beyond supersededby), such as
permitting a later technical report that is linked from the page.
Examples:  <a
href="http://homes.cs.washington.edu/~mernst/pubs/instantiating-generics-oopsla2004-abstract.html">http://homes.cs.washington.edu/~mernst/pubs/instantiating-generics-oopsla2004-abstract.html</a>,
<a href="http://pag.csail.mit.edu/pubs/deadlock-library-ecoop2005-abstract.html">http://pag.csail.mit.edu/pubs/deadlock-library-ecoop2005-abstract.html</a>.
(I think this may already be supported...)
</p>

<p>
Create a shared utility package for duplicated subroutines like
read_link_names.
Also, some code for the linkauthors option was copied from make-author-pages.pl;
this should be consolidated.
</p>

<p>
Permit printing superseded articles rather than suppressing them (but do
add links to the subsequent version); this gives a list of all
publications, including duplicates.
</p>

<p>
The Perl expressions in -filter arguments can get long;
permit simplifying them.  For examples, add a -omitiffieldexists and/or
an -includeiffieldexists?
</p>

<p>
Add a noabstractpage field, to replace the old nobasefilename field.
<!--
  (Then get rid of files Ernst89a-abstract.html and Ernst89c-abstract.html.)
-->
</p>

<!-- Such a trivial non-problem that I've commented it out. -->
<!--
<p>
htmllist output format : generates a newline (in the HTML source)
is generated for each entry, even if it's omitted!  Is there a way to tell
the system to stop processing entries?
</p>
-->

<p>
When the <code>-q</code> flag is supplied, this warning message
</p>
<pre>
Parsing of undecoded UTF-8 will give garbage when decoding entities at checklink.pl line 1075.
</pre>
<p>
appears to be referring to the last page whose URL is printed (the last
page for which there was a problem).  The warning message is coming from
HTML::Parser, but I can't find the exact place in the code (maybe it's in
C, not Perl?), and the parse method doesn't return an error status.  The
workaround is to run without the <code>-q</code> command-line option,
determine where the problem is, and fix it.
Alternately, follow these suggestsions from HTML::Parser:
  The solution is to use the Encode::encode_utf8() on the data before
  feeding it to the $p-&gt;parse().  For $p-&gt;parse_file() pass a file that
  has been opened in ":utf8" mode.

  The parser can process raw undecoded UTF-8 sanely if the C&lt;utf8_mode&gt;
  is enabled or if the "attr", "@attr" or "dtext" argspecs is avoided.
</p>

</body>
</html>

<!--  LocalWords:  bibtex webpages htmlabstract htmlsummary htmllist bwconv pl
 -->
<!--  LocalWords:  README BPHOME csh setenv basefilename ps pdf ppt alsosee dir
 -->
<!--  LocalWords:  downloadsnonlocal supersededby omitfromcv onlycrossref html
 -->
<!--  LocalWords:  crossref underreview informat outformat htmlpubs outopts bp
 -->
<!--  LocalWords:  linknames linkauthors myauthorslist withbibtex BWBIN BibTeX
 -->
<!--  LocalWords:  headfoot BIBFILES timestamp ctime Sameer Ajmani btool br dl
 -->
<!--  LocalWords:  noabstractpage nobasefilename Webpage webpage ConfVer grep
 -->
<!--  LocalWords:  omitiffield includeiffield nodownloads validurls urls LNCS
 -->
<!--  LocalWords:  STDERR url
 -->
